GetGroups Method

Syntax

GetGroups as P (includeUsers as L, ou as C)

Arguments

includeUsersLogical

Set to .T. to include the list of users in the group objects that are returned. Defaults to .F.

Including users could make this method run for a long time.

ouCharacter

The name of an organizational unit from which to restrict the list of groups. Defaults to empty string.

Returns

groupsArray of WindowsServices::ActiveDirectory::Group (use as type P)

Returns an array of WindowsServices::ActiveDirectory::Group objects. Check the domain object's CallResult to see if the method succeeds.

Description

Get the groups for a WindowsServices::ActiveDirectory::Domain object. Optionally include the users in the groups and optionally restrict the groups to a specific organizational unit.

'The follow line assumes that the machine is joined to an Active Directory domain and is allow to query Active Directory.
dim domain as WindowsServices::ActiveDirectory::Domain = new WindowsServices::ActiveDirectory::Domain()
if .not. domain.CallResult.Success then
	?"There was an error connecting to an Active Directory domain: " + domain.CallResult.Text + crlf()
	goto exitTestFunction
end if
	
?"The domain name is " + domain.Name + crlf()

dim groups as p = domain.getGroups(.f., "")
if .not. domain.CallResult.Success then
	?"There was an error getting groups: " + domain.CallResult.Text + crlf()
	goto exitTestFunction
end if

for each group in groups
	?group.Name + crlf()
next
	
exitTestFunction: